<template>
  <div class="content cl">
    <div class="left_new fl">
      <div class="left_tit cl">
        <h2 class="tit_left fl">最新资讯</h2>
        <a href="#" class="tit_right fr">...</a>
      </div>
      <ul class="new_item_top cl">
        <li>2019全明星赛投票正式开启！</li>
        <li>S10总决赛城市落户上海</li>
        <li>FPX：从季后赛边缘到全球冠军</li>
      </ul>
      <ul class="new_item_middle cl">
        <li>一张图看懂首届LPL全明星周末</li>
        <li>Doinb：想赚钱就别来LPL！</li>
        <li>央视官博祝贺FPX夺冠</li>
        <li>Caps：Doinb成功摧毁了我</li>
        <li>FPX夺冠LWX直言G2打得不行</li>
      </ul>
      <ul class="new_item_bottom cl">
        <li class="cl fl" v-for="el in newArr" :key="el.id">
          <p class="fl">
            <span v-if="el.video!==undefined">[>]</span>
            <a href="JavaScript:void(0)">{{el.title}}</a>
          </p>
          <p class="fl">{{el.time}}</p>
        </li>
      </ul>
    </div>
    <div class="center_video fl" @mouseenter="btn_add_color" @mouseleave="btn_delete_color">
      <div v-show="show" class="details">
        <el-button class="btn">进入直播间</el-button>
      </div>
      <div class="left_tit cl">
        <h2 class="tit_left fl">
          正在点播：
          <span>S9决赛 FPX vs G2_03</span>
        </h2>
        <a href="#" class="tit_right fr">...</a>
      </div>
      <div class="center_video_pally">
        <video
          src="//maoyan.meituan.net/movie/videos/854x480e9df22d1cc6e4e57ab0f42737d4a93e1.mp4"
          controls
          autoplay
        ></video>
      </div>
    </div>
    <div class="right_Demand">
      <div class="right_Demand_top">
        <h2 class="tit_left fl">最新资讯</h2>
        <a href="#" class="tit_right fr">...</a>
      </div>
      <div class="right_Demand_middle">
        <p>
          <span>2019全球总决赛</span> 淘汰赛 半决赛 BO5
        </p>
        <div class="right_Demand_middle_bifen"></div>
        <div class="right_Demand_middle_bifen"></div>
        <p>
          <span>2019全球总决赛</span> 淘汰赛 半决赛 BO5
        </p>
        <div class="right_Demand_middle_bifen"></div>
      </div>
      <div class="right_Demand_bottom_huigu">
        <ul class="right_Demand_bottom_huigu_top cl">
          <li
            class="right_Demand_bottom_huigu_top_list"
            v-for="(el,index) in brArr"
            :key="el.id"
            @click="qiehua(el.id)"
          >
            <div class="bottom_border" v-if="el.id===isindex||myindex"></div>
            <a
              :class="{acolor:el.id===isindex||myindex}"
              href="JavaScript:void(0)"
              @click="liclick(index)"
              @mouseenter="lienter(index)"
              @mouseleave="lileave()"
            >{{el.tit}}</a>
          </li>
        </ul>
        <div class="huigu">
          <div class="hg_click_left" @click="hgLeft"></div>
          <div class="hg_click_right" @click="hgRight"></div>
          <div class="right_Demand_bottom_Huigu">
            <ul class="right_Demand_bottom_huigu_bottom cl">
              <li v-for="key in Arr" :key="key.id" class="fl">
                <div>
                  <img :src="key.img" :title="key.alt" />
                </div>
                <h4>{{key.tit}}</h4>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
    <div class="bottom_saishi">
      <div class="left_saishi">
        <div class="left_tit cl">
          <h2 class="tit_left fl">赛事栏目</h2>
          <a href="#" class="tit_right fr">...</a>
        </div>
        <ul class="saishi_tep" @mouseover="maximg" @mouseout="minimg">
          <li v-for="el in imgArr" :key="el.id">
            <div class="sc_img">
              <img class="faimg" :src="el.src" alt />
            </div>
            <p>
              <span>{{el.tit}}</span>
              <span>{{el.time}}</span>
            </p>
          </li>
        </ul>
      </div>
      <div class="right_tuijian">
        <div class="left_tit cl">
          <h2 class="tit_left fl">精品推荐</h2>
          <a href="#" class="tit_right fr">...</a>
        </div>
        <div class="lunbo">
          <div class="block">
            <el-carousel height="254px">
              <el-carousel-item v-for="item in lunboArr" :key="item.id">
                <img :src="item.src" alt />
                <h3 class="small">{{ item.title }}</h3>
              </el-carousel-item>
            </el-carousel>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data: () => ({
    show: false,
    isindex: 0,
    myindex: undefined,
    brArr: [
      {
        id: 0,
        flag: true,
        tit: '全场回顾',
        color: true
      },
      {
        id: 1,
        flag: false,
        tit: '巅峰时刻',
        color: false
      }
    ],
    Arr: [],
    huihuArr: [
      {
        id: 0,
        img: '//puui.qpic.cn/vpic/0/y0032iqzzak.png/0',
        alt: '第一场',
        tit: 'S9决赛 FPX vs G2_01'
      },
      {
        id: 1,
        img: '//puui.qpic.cn/vpic/0/l0032n9zatn.png/0',
        alt: '第一场',
        tit: 'S9决赛 FPX vs G2_02'
      },
      {
        id: 2,
        img: '//puui.qpic.cn/vpic/0/y0032iqzzak.png/0',
        alt: '第一场',
        tit: 'S9决赛 FPX vs G2_03'
      },
      {
        id: 3,
        img: '//puui.qpic.cn/vpic/0/l0032n9zatn.png/0',
        alt: '第一场',
        tit: 'S9决赛 FPX vs G2_04'
      },
      {
        id: 4,
        img: '//puui.qpic.cn/vpic/0/l0032n9zatn.png/0',
        alt: '第一场',
        tit: 'S9决赛 FPX vs G2_05'
      },
      {
        id: 5,
        img: '//puui.qpic.cn/vpic/0/l0032n9zatn.png/0',
        alt: '第一场',
        tit: 'S9决赛 FPX vs G2_06'
      },
      {
        id: 6,
        img: '//puui.qpic.cn/vpic/0/l0032n9zatn.png/0',
        alt: '第一场',
        tit: 'S9决赛 FPX vs G2_07'
      }
    ],
    huiguAee2: [
      {
        id: 0,
        img: 'http://puui.qpic.cn/qqvideo_ori/0/w3019fmk10f_228_128/0',
        alt: '第一场',
        tit: 'FPX主动出击盲僧神来一脚 助团队收下大龙'
      },
      {
        id: 1,
        img: 'http://puui.qpic.cn/qqvideo_ori/0/w3019fmk10f_228_128/0',
        alt: '第一场',
        tit: 'FPX主动出击盲僧神来一脚 助团队收下大龙'
      },
      {
        id: 2,
        img: 'http://puui.qpic.cn/qqvideo_ori/0/w3019fmk10f_228_128/0',
        alt: '第一场',
        tit: 'FPX主动出击盲僧神来一脚 助团队收下大龙'
      },
      {
        id: 3,
        img: 'http://puui.qpic.cn/qqvideo_ori/0/w3019fmk10f_228_128/0',
        alt: '第一场',
        tit: 'FPX主动出击盲僧神来一脚 助团队收下大龙'
      },
      {
        id: 4,
        img: 'http://puui.qpic.cn/qqvideo_ori/0/w3019fmk10f_228_128/0',
        alt: '第一场',
        tit: 'FPX主动出击盲僧神来一脚 助团队收下大龙'
      },
      {
        id: 5,
        img: 'http://puui.qpic.cn/qqvideo_ori/0/w3019fmk10f_228_128/0',
        alt: '第一场',
        tit: 'FPX主动出击盲僧神来一脚 助团队收下大龙'
      },
      {
        id: 6,
        img: 'http://puui.qpic.cn/qqvideo_ori/0/w3019fmk10f_228_128/0',
        alt: '第一场',
        tit: 'FPX主动出击盲僧神来一脚 助团队收下大龙'
      }
    ],
    newArr: [
      {
        id: 0,
        title: 'LPL全明星投票进行中 FPX四人上榜 榜一上野堪称梦幻',
        time: '11-03'
      },
      {
        id: 1,
        title: 'LPL全明星投票进行中 FPX四人上榜 榜一上野堪称梦幻',
        time: '11-03'
      },
      {
        id: 2,
        title: 'LPL全明星投票进行中 FPX四人上榜 榜一上野堪称梦幻',
        time: '11-03'
      },
      {
        id: 3,
        title: 'LPL全明星投票进行中 FPX四人上榜 榜一上野堪称梦幻',
        time: '11-03',
        video: '111'
      },
      {
        id: 4,
        title: 'LPL全明星投票进行中 FPX四人上榜 榜一上野堪称梦幻',
        time: '11-03'
      },
      {
        id: 5,
        title: 'LPL全明星投票进行中 FPX四人上榜 榜一上野堪称梦幻',
        time: '11-03'
      },
      {
        id: 6,
        title: 'LPL全明星投票进行中 FPX四人上榜 榜一上野堪称梦幻',
        time: '11-03',
        video: '111'
      },
      {
        id: 7,
        title: 'LPL全明星投票进行中 FPX四人上榜 榜一上野堪称梦幻',
        time: '11-03'
      },
      {
        id: 8,
        title: 'LPL全明星投票进行中 FPX四人上榜 榜一上野堪称梦幻',
        time: '11-03'
      },
      {
        id: 9,
        title: 'LPL全明星投票进行中 FPX四人上榜 榜一上野堪称梦幻',
        time: '11-03'
      },
      {
        id: 10,
        title: 'LPL全明星投票进行中 FPX四人上榜 榜一上野堪称梦幻',
        time: '11-03'
      },
      {
        id: 11,
        title: 'LPL全明星投票进行中 FPX四人上榜 榜一上野堪称梦幻',
        time: '11-03'
      },
      {
        id: 12,
        title: 'LPL全明星投票进行中 FPX四人上榜 榜一上野堪称梦幻',
        time: '11-03'
      }
    ],
    imgArr: [
      {
        id: 0,
        src:
          'https://shp.qpic.cn/cfwebcap/0/9b630bf2c4e1e50e0acb28806dcec917/0/',
        tit: '电竞肝帝',
        time: '2019-11-14'
      },
      {
        id: 1,
        src:
          'https://shp.qpic.cn/cfwebcap/0/35c3e3d69fa1b07a2efbd3d539b4fbc6/0/',
        tit: '蕉游日记',
        time: '2019-11-13'
      }
    ],
    lunboArr: [
      {
        id: 0,
        src:
          'https://shp.qpic.cn/cfwebcap/0/65f324549b3322356757339d6f28958c/0/',
        title: '2020全球总决赛决赛城市落户上海'
      },
      {
        id: 1,
        src:
          'https://shp.qpic.cn/cfwebcap/0/1f5d5840f0d6080c8c92973e0c103d6b/0/',
        title: 'FPX谈冠军皮肤：上单与野辅已经确定！双C仍在犹豫中'
      },
      {
        id: 2,
        src:
          'https://shp.qpic.cn/cfwebcap/0/3d850fcd5a8aedcb4cd6358a5128ad99/0/',
        title: 'FPX谈冠军皮肤：上单与野辅已经确定！双C仍在犹豫中'
      },
      {
        id: 3,
        src:
          'https://shp.qpic.cn/cfwebcap/0/3c6faedff908d91250cabf4b5a00ca26/0/',
        title: 'PDD成最大赢家 两大弟子都达成FMVP成就'
      }
    ]
  }),
  mounted () {
    this.qiehua(0)
  },
  methods: {
    btn_add_color () {
      this.show = !this.show
    },
    btn_delete_color () {
      this.show = !this.show
    },
    liclick (index) {
      this.isindex = index
      this.myindex = undefined
    },
    lienter (index) {
      this.myindex = index + 1
    },
    lileave () {
      this.myindex = undefined
    },
    hgLeft () {
      var hgUl = document.getElementsByClassName(
        'right_Demand_bottom_huigu_bottom'
      )[0]
      hgUl.style.left =
        hgUl.offsetLeft - hgUl.offsetWidth / this.huihuArr.length + 'px'
      if (
        Math.abs(hgUl.offsetLeft) >
        hgUl.offsetWidth - (hgUl.offsetWidth / this.huihuArr.length) * 2
      ) {
        hgUl.style.left =
          -(hgUl.offsetWidth - (hgUl.offsetWidth / this.huihuArr.length) * 2) +
          'px'
      }
    },
    hgRight () {
      var hgUl = document.getElementsByClassName(
        'right_Demand_bottom_huigu_bottom'
      )[0]
      hgUl.style.left =
        hgUl.offsetLeft + hgUl.offsetWidth / this.huihuArr.length + 'px'
      if (hgUl.offsetLeft >= 0) {
        hgUl.style.left = 0 + 'px'
      }
    },
    qiehua (index) {
      var hgUl = document.getElementsByClassName(
        'right_Demand_bottom_huigu_bottom'
      )[0]
      if (index === 0) {
        this.Arr = this.huihuArr
        hgUl.style.left = 0 + 'px'
      } else {
        this.Arr = this.huiguAee2
        hgUl.style.left = 0 + 'px'
      }
    },
    maximg (evt) {
      var e = evt || window.event
      var ele = e.target || e.srcelement
      if (ele.className === 'faimg') {
        ele.style.transform = 'scale(1.1)'
      }
    },
    minimg (evt) {
      var e = evt || window.event
      var ele = e.target || e.srcelement
      if (ele.className === 'faimg') {
        ele.style.transform = 'scale(1)'
      }
    }
  }
}
</script>
<style lang="less" scoped>
.content {
  background: #f7f7f7;
  width: 1360px;
  margin: auto;
  .left_new {
    width: 440px;
  }
  .left_tit {
    height: 20px;
    width: 100%;
    // background: rgb(122, 117, 117);
    padding-bottom: 18px;
    // border: 1px solid #ccc;
    .tit_left {
      border-left: 4px solid #1da6ba;
      padding-left: 10px;
      span {
        color: #1da6ba;
      }
    }
    .tit_right {
      font-size: 18px;
      font-weight: bold;
      margin-right: 10px;
    }
  }
  .new_item_top,
  .new_item_middle,
  .right_Demand_top {
    width: 100%;
    white-space: nowrap;
    text-overflow: ellipsis;
    li {
      height: 24px;
      width: 50%;
      float: left;
      text-align: center;
      line-height: 24px;
    }
    li:nth-of-type(1) {
      width: 100%;
      font-size: 20px !important;
      color: #0da0b4 !important;
      height: 38px;
      line-height: 38px;
    }
  }
  .new_item_bottom {
    width: 100%;
    li {
      width: 100%;
      height: 40px;
      line-height: 40px;
      border-bottom: 1px solid #ccc;
      p:nth-child(1) {
        width: 390px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        height: 40px;
        text-align: left
      }
      :hover {
        color: #cea04a !important;
      }
      p:nth-child(2) {
        color: #9d9d9d;
        width: 10%;
        width: #00f;
        text-overflow: ellipsis;
        white-space: nowrap;
        height: 40px;
        text-align: right;
        margin-left:5px;
      }
    }
  }
  .center_video {
    margin-bottom: 75px;
    height: 354px;
    width: 620px;
    margin-left: 30px;
    position: relative;
    .details {
      width: 140px;
      height: 40px;
      position: absolute;
      bottom: 40%;
      left: 50%;
      margin-left: -70px;
      z-index: 10;
      .btn {
        border: 2px solid #cea04a !important;
        width: 140px;
        height: 40px;
        background: rgba(0, 0, 0, 0.65);
        color: #cea04a;
        text-align: center;
        line-height: 20px;
        font-size: 14px;
      }
    }
    .center_video_pally {
      height: 100%;
      width: 100%;
      video {
        height: 100%;
        width: 100%;
      }
    }
  }
  .right_Demand {
    height: 300px;
    width: 270px;
    float: left;
    .right_Demand_top {
      height: 20px;
      width: 100%;
      // background: rgb(122, 117, 117);
      padding-bottom: 18px;
      // border: 1px solid #ccc;
      .tit_left {
        border-left: 4px solid #1da6ba;
        padding-left: 10px;
        span {
          color: #1da6ba;
        }
      }
      .tit_right {
        font-size: 18px;
        font-weight: bold;
      }
    }
    .right_Demand_middle {
      width: 100%;
      p {
        width: 100%;
        height: 23px;
        box-sizing: border-box;
        padding-left: 7px;
        overflow: hidden;
        font-size: 12px;
        line-height: 23px;
        color: #fff;
        text-align: left;
        background-color: #b9b9b9;
        span {
          color: #424242;
        }
      }
      .right_Demand_middle_bifen {
        height: 60px;
        width: 100%;
        background: url("../../images/1.png");
        border: solid 1px #ccc;
      }
    }
    .right_Demand_bottom_huigu {
      width: 100%;
      .huigu {
        position: relative;
        .hg_click_left {
          position: absolute;
          height: 42px;
          width: 15px;
          background: url("../../images/sprite-img.png");
          background-size: 73px 73px;
          background-repeat: no-repeat;
          top: 15px;
          left: 4px;
          cursor: pointer;
        }
        .hg_click_right {
          position: absolute;
          height: 42px;
          width: 15px;
          background: url("../../images/sprite-img.png");
          top: 15px;
          right: 4px;
          cursor: pointer;
          background-size: 73px 73px;
          background-repeat: no-repeat;
          background-position: -18px 0;
        }
      }
      .right_Demand_bottom_huigu_top {
        margin-bottom: 10px;
        width: 100%;
        height: 20px;
        overflow: inherit;
        .acolor {
          color: #1da6ba;
        }
        li {
          float: left;
          // background: #1da6ba;
          position: relative;
          height: 100%;
          line-height: 20px;
          text-align: center;
          width: 50%;
          .bottom_border {
            position: absolute;
            top: 16px;
            left: 38px;
            height: 10px;
            width: 60px;
            background: url("../../images/comm1901.png");
            background-position: -181px 0;
            z-index: 10;
          }
        }
        border-bottom: 1px solid #eef0f0;
      }
      .right_Demand_bottom_Huigu {
        overflow: hidden;
        width: 230px;
        margin: auto;
        height: 92px;
        position: relative;
      }
      .right_Demand_bottom_huigu_bottom {
        position: absolute;
        height: 92px;
        width: 536.6px;
        left: 0px;
        li {
          height: 92px;
          width: 76px;
          margin-left: 0.66px;
          div {
            width: 100%;
            height: 42px;
            background: #f00;
            img {
              height: 100%;
              width: 100%;
            }
          }
          h4 {
            margin-top: 8px;
            width: 100%;
            height: 38px;
            overflow: hidden;
            font-size: 12px;
            color: #424242;
            font-weight: 400;
          }
        }
      }
    }
  }
  .bottom_saishi {
    height: 290px;
    width: 890px;
    float: right;
    .left_saishi {
      width: 430px;
      height: 100%;
      float: left;
      .saishi_tep {
        height: 100%;
        width: 100%;
        li {
          height: 100%;
          width: 48%;
          float: left;
          .sc_img {
            height: 75%;
            width: 100%;
            overflow: hidden;
            img {
              height: 100%;
              width: 100%;
            }
          }
          p {
            height: 25%;
            width: 100%;
            line-height: 32px;
            span:nth-child(1) {
              float: left;
            }
            span:nth-child(2) {
              float: right;
            }
          }
        }
        li:nth-of-type(1) {
          margin-right: 2%;
        }
      }
    }
    .right_tuijian {
      width: 430px;
      height: 100%;
      float: right;
      // background: #f0f;
      .lunbo {
        height: 100%;
        width: 100%;
        // background: #0da0b4;
        img {
          /*设置图片宽度和浏览器宽度一致*/
          width: 100%;
          height: inherit;
        }
        .el-carousel__item h3 {
          color: #475669;
          font-size: 14px;
          opacity: 0.75;
          line-height: 150px;
          margin: 0;
        }

        .el-carousel__item:nth-child(2n) {
          background-color: #99a9bf;
        }

        .el-carousel__item:nth-child(2n + 1) {
          background-color: #d3dce6;
        }
        .small {
          top: 150px;
          position: absolute;
          z-index: 1000;
          left: 0px;
          font-weight: bold;
          font-size: 16px!important;
          color: #cdbe91!important;
        }
      }
    }
  }
}
</style>
